<!doctype html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <style type="text/css">
      body,html,#container{
        height: 100%;
        margin: 0px;
      }
	  /* 定义  主题 */
    	.amap-ui-control-theme-my-set{ background:#fff;}
    </style>
    <title>静态地图生成</title>
  </head>
  <body>
  	<!--地图-->
  	<div style="position:relative;width:100%;height:70%;">
    	<div id="container" tabindex="0" style="width:100%;height:70%;""></div>
    </div>
    <!--操作-->
    <script type="text/javascript" src="b.js"></script>
	<script type="text/javascript" src="zepto.js"></script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=9a621a769237615e36fe158651cc8e1f"></script>
    <script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js"></script>
    <script type="text/javascript">

	    //创建地图
		var map = new AMap.Map('container');
		map.setZoom(5);
		map.setCenter([116.39,39.9]);
		AMap.event.addListener(map,'zoomend',function(){
			console.log("当前缩放级别："+map.getZoom());
		});
		//ui
		
		//加载DistrictCluster，loadUI的路径参数为模块名中 'ui/' 之后的部分 
		AMapUI.loadUI(['geo/DistrictCluster'], function(DistrictCluster) {

		    var distCluster = new DistrictCluster({
		        map: map, //所属的地图实例
		        //返回数据项中的经纬度位置
		        getPosition: function(item) {
		            return item.position;
		        }
		    });

			$.get('http://a.amap.com/amap-ui/static/data/10w.txt', function(csv) {

				console.log(csv)
	            var data = csv.split('\n');

	            distCluster.setData(data);

	        });



		});

		
			
	
    </script>
  </body>
</html>
